package com.base.core.exception;

public abstract class BaseErrorCode {
    protected final int code;
    protected final String message;

    protected BaseErrorCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        // 组合模块前缀和具体错误码
        return getModulePrefix() * 1000 + code;
    }

    public String getMessage() {
        return message;
    }

    // 抽象方法，子类必须实现
    protected abstract int getModulePrefix();
}